/* Starting CSS */
html {
  --color: #333333;
  --label-color: #6d6d6d;
  --placeholder-color: #ababab;
  --font-family: sans-serif;
  --background: #fafafa;
  --background-card: #ffffff;
  --primary: #e48b17;
  --accent: #086788;
  --accent-contrast: #ffffff;
  --error: #dd1c1aff;
  --border: #ddd;
  --hover: #bee0eb;
  
  color: var(--color);
  font-family: var(--font-family);
  font-size: 12pt;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--background);
  background-image: radial-gradient(var(--accent) .75px, transparent .75px);
  background-size: 15px 15px;
  margin: 0;
  padding: 2rem;
}

main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 1rem auto;
  max-width: 1200px;
  box-shadow: -2px 2px 15px 0 var(--border);
}

.image {
  background-image: url("/img/illustration.jpeg");
  background-size: cover;
  background-position: bottom center;
  object-fit: contain;
}

.contact-form {
  background-color: var(--background-card);
  padding: 2rem;
}

h1 { color: var(--accent); }

/* End Starting CSS */

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

input:not([type="radio"], [type="checkbox"]),
textarea,
select {
  font-size: 1rem;
  font-family: inherit;
  color: inherit;
  border: none;
  border-bottom: solid 1px var(--primary);
  border-image: linear-gradient(to right, var(--primary), var(--accent)) 1;
  padding: 0 0 .25rem;
  width: 100%;
  background-color: var(--background-card);
}

textarea { resize: vertical }

input[type="radio"],
input[type="checkbox"] {
  /* accent-color: var(--accent); */
  appearance: none;
  background-color: var(--background);
  margin: 0;
  width: 1.75em;
  height: 1.75em;
  border: 1px solid currentcolor;
  display: inline-grid;
  place-content: center;
}
input[type="radio"] { border-radius: 50% }
input[type="checkbox"] { border-radius: 4px }

:where(input[type="radio"], input[type="checkbox"])::before {
  display: block;
  content: '';
  width: 1em;
  height: 1em;
}

:where(input[type="radio"], input[type="checkbox"]):hover::before {
  background: var(--hover);
}

:where(input[type="radio"], input[type="checkbox"]):checked::before {
  background: var(--accent);
}

input[type="radio"]::before { border-radius: 50% }
input[type="checkbox"]::before {
  clip-path: polygon(14% 44%, 0% 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

:is(input[type="radio"], input[type="checkbox"]):checked {
  border-color: var(--accent);
}

label, legend { 
  display: flex;
  align-items: center;
  gap: .25rem;
  margin: 0 0 .5rem 0;
  font-size: .875rem;
  color: var(--label-color);
}

::placeholder {
  color: var(--placeholder-color);
  font-size: .75em;
}

button[type="submit"] {
  border: none;
  border-radius: 36px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 1rem;
  cursor: pointer;
  padding: .5rem 2rem;
}
.actions { margin-top: 2rem }

.error {
  color: var(--error);
  margin: .25rem 0 2rem;
}
.error span::before {
  content: url("./img/error.svg");
  display: inline-block;
  width: 1.25ex;
  height: 1.25ex;
  vertical-align: baseline;
  margin-right: .5ch;
}

.error span { display: none; }

.dirty:invalid + .error span {
  display: inline;
}

:is(input, textarea).dirty:invalid {
  border-color: var(--error);
  border-image: none;
}

:is(
  input:not([type="radio"], [type="checkbox"]),
  textarea,
  select
):focus-visible {
  outline: none;
  border-bottom: dashed 1px var(--primary);
  border-image: none;
}

:is(
  input:not([type="radio"], [type="checkbox"]).dirty:invalid,
  textarea.dirty:invalid,
  select.dirty:invalid
):focus-visible {
  border-color: var(--error);
}

:is(input[type="radio"],  [type="checkbox"]):focus-visible {
  outline: dashed 1px var(--primary);
  outline-offset: 2px;
}

select:hover { cursor: pointer }

@media (forced-colors: active) {
  :where(input[type="radio"], input[type="checkbox"]):checked::before {
    background-color: CanvasText;
  }
}
